package gameobjects;

public class Actor extends Entity {
	private int health;
	private int moveSpeed;
	private int gravity;
	private int jumpHeight;
	
	public Actor(){
		
	}
	
	public Actor(int h, String n, String s, int x, int y, int w, int he, int hp, int ms, int gra){
		super(h,n,s,x,y,w,he);
		health = hp;
		moveSpeed = ms;
		gravity = gra;
		jumpHeight = 100;
	}
	
	public boolean reduceHealth(int delta){
		health -= delta;
		return health <= 0;
	}

	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		this.health = health;
	}

	public int getMoveSpeed() {
		return moveSpeed;
	}

	public void setMoveSpeed(int moveSpeed) {
		this.moveSpeed = moveSpeed;
	}

	public int getGravity() {
		return gravity;
	}
	
	public void setGravity(int gravity) {
		this.gravity = gravity;
	}
	
	public void fall() {
		if (getY()>gravity+2)
			setY(getY()-gravity-2);
		else{
			setY(0);
			gravity = 0;
		}
	}
	
	public void incrementGravity(int delta) {
		gravity += delta;
	}
	
	public int getJumpHeight() {
		return jumpHeight;
	}

	public void setJumpHeight(int jumpHeight) {
		this.jumpHeight = jumpHeight;
	}
	
}
